﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Itop.YHPC.Model;
using System.Collections.Generic;
using Itop.YHPC.controller;
using System.IO;

namespace Itop.YHPC.workflow
{
    public partial class workflow_dict_ajax : AjaxPage<yhpcDictionary>
    {
        protected override IList<yhpcDictionary> onRead()
        {
            string sType = Request.QueryString["sType"];
            //StreamWriter sw = new StreamWriter("c:\\dic.log");
            //sw.WriteLine(sType);
            //sw.WriteLine(Server.UrlDecode(sType));
            //sw.WriteLine(Server.HtmlDecode(sType));
            //sw.WriteLine(Request.RawUrl);
            //sw.Close();
            string search = Request.QueryString["search"];
            IList<yhpcDictionary> list = workflowController.GetDictList("where type='" + sType + "' order by orderid");
            if(!string.IsNullOrEmpty(search))
            {
                yhpcDictionary dict = new yhpcDictionary();
                dict.id = Guid.NewGuid().ToString();
                dict.type = sType;
                dict.text = "全部";
                list.Insert(0, dict);
            }
            return list;

        }
    }
}
